/*
 * PeerIdentifier.cpp
 *
 *  Created on: 27/06/2014
 *      Author: Caina
 */

#include "PeerIdentifier.h"

PeerIdentifier::PeerIdentifier() {
	srand(time(NULL));
	identifier = rand();
	ipAddr = 0;
}

PeerIdentifier::PeerIdentifier(unsigned int ipAddr, unsigned int identifier) :
		ipAddr(ipAddr), identifier(identifier) {

}

PeerIdentifier::~PeerIdentifier() {
}

bool PeerIdentifier::is(unsigned int id) {
	return identifier == id;
}

unsigned int PeerIdentifier::get_identifier() {
	return identifier;
}

unsigned int PeerIdentifier::get_ip_address() {
	return ipAddr;
}

void PeerIdentifier::set_ip_address(unsigned int ipAddr) {
	this->ipAddr = ipAddr;
}
